<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>登录注册</title>
    <link rel="stylesheet" href="../../../../../index.php">
    <link rel="stylesheet" href="../../../../../index.php">
    <!--[if lt IE 9]>
    <script src="__HJS__html5shiv.min.js"></script>
    <script src="__HJS__respond.min.js"></script>
    <![endif]-->
    <script src="../../../../../index.php"></script>
    <script src="../../../../../index.php"></script>
    <script src="../../../../../index.php"></script>
    <script src="../../../../../index.php"></script>
</head>
  </head>
  <body>
  <!--header-->
  <div class="navbar navbar-default header">
      <div class="container">
          <div class="navbar-header">
              <a class="navbar-brand" href="javascript:;">欢迎来到易术网!</a>
          </div>
      </div>
  </div>
  <!--logo-->
  <div class="logoBox">
      <div class="container">
          <a href="javascript:;">
              <span class="logo"></span>
          </a>
      </div>
  </div>
  <!--main-->
  <div class="main">
      <div class="container-fluid bgColor">
          <div class="container">
              <img src="../../../../../index.php" alt=""/>

              <div class="box">
                  <div class="login-content">
                    <div class="list">
                          <ul class="list-inline nav nav-tabs " role="tablist">
                              <li role="presentation" class="active">
                                  <a href="#login"role="tab" data-toggle="tab">用户登录</a>
                              </li>
                              <li role="presentation">
                                  <a href="#register" role="tab" data-toggle="tab">用户注册</a>
                              </li>
                          </ul>

                          <div class="tab-content">
                               <div role="tabpanel" class="tab-pane active" id="login">
                                   <div class="form">
                                       <form id="lg_login" action="{:U('Doctor/login')}" method="post">
                                           <div class="form-group">
                                               <div class="col-xs-12">
                                                   <div class="input-group">
                                                      <span class="input-group-addon">
                                                          <span class="glyphicon glyphicon-user"></span>
                                                      </span>
                                                       <input type="text" id="lgusername" name="name" class="form-control" placeholder="请输入登录账号">

                                                   </div>
                                               </div>
                                           </div>
                                           <div class="form-group">
                                               <div class="col-xs-12">
                                                   <div class="input-group">
                                                        <span class="input-group-addon">
                                                              <span class="glyphicon glyphicon-lock"></span>
                                                         </span>
                                                       <input type="password" id="lgpassword" name="pwd" class="form-control" placeholder="请输入登录密码">
                                                   </div>
                                               </div>
                                           </div>

                                           <div class="form-group">
                                               <div class="col-xs-8 link">
                                                   <div class="input-group">
                                                       <span class="input-group-addon"><span class="glyphicon glyphicon-check"></span></span>
                                                       <input type="text" id="lgyanzhengma" name="code" class="form-control" placeholder="请输入验证码" onblur="if(this.value==''){this.value='验证码'}" onclick="if(this.value=='验证码'){this.value='';}" value="验证码" style="width: 100px;" required="required">
                                                   </div>
                                               </div>
                                               <div class="col-xs-4 link btn_size">
                                                   <!--<input type="submit" value="获取验证码"/>-->
                                                   <img src="{:U('Doctor/verify')}" class="verify" onclick="changeYzm(this)">
                                               </div>

                                           </div>

                                           <div class="form-group">
                                               <div class="col-xs-6 link">
                                                   <p class="text-center remove-margin">
                                                       <input type="checkbox"/><small>记住登录密码</small>
                                                   </p>
                                               </div>
                                               <div class="col-xs-6 link">
                                                   <p class="text-center remove-margin">
                                                       <a href="{:U('Doctor/showPwd')}" ><small class="small">忘记密码？</small></a>
                                                   </p>
                                               </div>
                                           </div>
                                           <div class="form-group form-actions">
                                               <div class="col-xs-12">
                                                   <button type="submit" id="logonBtn" class="btn btn-lg btn-block login_btn">登录</button>
                                               </div>
                                           </div>
                                       </form>
                                   </div>
                               </div>
                               <div role="tabpanel" class="tab-pane" id="register">
                                   <div class="form">
                                       <form enctype="multipart/form-data" id="re_register" action="{:U('Doctor/reg')}" method="POST"  onsubmit="return(test())">
                                           <input type="hidden" name="id">
                                           <div class="form-group">
                                               <div class="col-xs-12">
                                                   <div class="input-group">
                                                      <span class="input-group-addon">
                                                          <span class="glyphicon glyphicon-user"></span>
                                                      </span>
                                                       <input type="text" id="reusername" name="phone" class="form-control" placeholder="请输入登录账号">
                                                   </div>
                                               </div>
                                           </div>
                                           <div class="form-group">
                                               <div class="col-xs-12">
                                                   <div class="input-group">
                                                       <span class="input-group-addon">
                                                         <span class="glyphicon glyphicon-lock"></span>
                                                      </span>
                                                       <input type="PASSWORD" id="repassword" name="pwd" class="form-control" placeholder="请输入登录密码">
                                                   </div>
                                               </div>
                                           </div>
                                           <div class="form-group">
                                               <div class="col-xs-12">
                                                   <div class="input-group">
                                                       <span class="input-group-addon">
                                                         <span class="glyphicon glyphicon-lock"></span>
                                                      </span>
                                                       <input type="PASSWORD" id="re_password" name="pwd2" class="form-control" placeholder="请输入登录密码">
                                                   </div>
                                               </div>
                                           </div>

                                           <div class="form-group">
                                               <div class="col-xs-8 link">
                                                   <div class="input-group">
                                                       <span class="input-group-addon"><span class="glyphicon glyphicon-check"></span></span>
                                                       <input type="text" id="reyanzhengma" name="code" class="form-control" placeholder="请输入验证码" >
                                                   </div>
                                               </div>
                                               <div class="col-xs-4 link btn_size">
                                                   <input type="submit" value="获取验证码"/>
                                               </div>
                                           </div>

                                           <div class="form-group">
                                               <div class="col-xs-12">
                                                   <div class="input-group">
                                                       <span class="input-group-addon">
                                                         <span class="glyphicon glyphicon-upload"></span>
                                                      </span>
                                                       <div id="up_img">
                                                           <input type="file" id="reyishizhizhao" name="certification" class="form-control" placeholder="请上传医师执照">
                                                       </div>
                                                       <span class="input-group-addon">
                                                         <span class="glyphicon glyphicon-folder-open"></span>
                                                      </span>
                                                   </div>
                                               </div>
                                           </div>
                                           <div class="form-group">
                                               <div class="col-xs-6 link">
                                                   <p class="text-center remove-margin">
                                                       <input type="checkbox"/><small>我已同意******协议</small>
                                                   </p>
                                               </div>
                                           </div>
                                           <div class="form-group form-actions">
                                               <div class="col-xs-12">
                                                   <input type="submit" id="registerBtn" class="btn btn-lg btn-block login_btn">
                                               </div>
                                           </div>
                                       </form>
                                   </div>
                               </div>
                          </div>
                      </div>

                  </div>
              </div>
          </div>
      </div>
  </div>
  <div class="footer">
      <div class="container">
          <p class="text-center">
              Copyright © 2008-2014 Change360.cn All Rights Reserved 西安创知信息科技有限公司
          </p>
      </div>
  </div>
  </body>
<script>
    function test(){
        var phone = $("input[name='phone']").val();
        var pwd = $("#repassword").val();
        var reg = /^0?1[3|4|5|6|7|8][0-9]\d{8}$/;
        var regPwd =/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,12}$/;
      if(!phone){
            alert('手机号不能为空！');
            return false;
        }else {
          if(reg.test($("#reusername").val())) {
            }else{
                alert("号码格式错误");
            }
      }
        if(!pwd){
        alert('密码不能为空');
            return false;
        }else if(regPwd.test($("#repassword").val())){
        }else {
            alert('密码应为6~12位数组加字母组合');
            return false;
        }
    }
</script>
<script>
    function changeYzm(obj){
        var rand = parseInt(Math.random()*5);
        var url = "<?php echo U('Doctor/verify');?>"+"?rand="+rand;
        obj.src = url;
    }
</script>
  </html>